﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Zove.Runtime;
using Zove.DesignTime;
using EmbeddedSharp;
using EmbeddedSharp.Core;

namespace Zove.Desktop.Tools {
    public partial class ExpressionEvaluatorForm : Form, IDesktopView {
        public ExpressionEvaluatorForm() {
            InitializeComponent();
        }

        public void RunInBackground()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        public void Validate()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        public void Stop()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        public void Run() {
            try {
                Parser p = new Parser(this.tbExpression.Text);
                Node node = p.Parse();

                string result = node.Evaluate().ToString();
                MessageBox.Show(result);
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }

        #region IDesktopForm Members

        public DigitalRune.Windows.TextEditor.TextEditorControl GetTextEditorControl() {
            throw new NotImplementedException();
        }

        public string GetFileName() {
            throw new NotImplementedException();
        }

        public string GetFileExtension() {
            throw new NotImplementedException();
        }

        public void Export(string fileName) {
            throw new NotImplementedException();
        }

        public void Save(string fileName) {
            throw new NotImplementedException();
        }

        public string GetFileFilter() {
            throw new NotImplementedException();
        }

        public virtual string GetColourScheme() {
            return string.Empty;
        }

        #endregion

        #region IDesktopForm Members


        public void Debug() {
            throw new NotImplementedException();
        }

        public void Resume() {
            throw new NotImplementedException();
        }

        public void Restart() {
            throw new NotImplementedException();
        }

        public double Profile() {
            throw new NotImplementedException();
        }

        #endregion
    }
}
